﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Home/Site.Master" Inherits="ProjetoComperio.SystemFramework.Web.ComperioViewPage<ProjetoComperio.DataLayer.Entities.Comment>" %>

<%@ Import Namespace="ProjetoComperio.Presentation.Web.GlobalResources.HtmlHelper" %>
<%@ Import Namespace="ProjetoComperio.DataLayer.Entities" %>
<%@ Import Namespace="Telerik.Web.Mvc.UI" %>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        Discussão
    </h2>
    <table align="center" width="70%">
        <tr>
            <td>
                <div id="SubjectTitle" style="background-color: #E5E5E5; height: 30px">
                    <%: ViewData["SubjectTitle"].ToString() %>
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <%: ViewData["SubjectMessage"].ToString() %>
            </td>
        </tr>
        <tr>
            <td>
                <label for="Description" class="Textboxlabel">
                    <%:  ViewData["SubjectUserName"].ToString()%>
                    -
                    <%:  ViewData["SubjectCreatedDate"]  %>
                </label>
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;&nbsp;&nbsp;
            </td>
        </tr>
        <%                
            if (ViewData["Comments"] != null)

                foreach (var comment in ViewData["Comments"] as IQueryable<Comment>)
                {  %>
        <tr>
            <td align="left">
                <fieldset>
                    <legend>
                        <%: comment.UserName + " / " + comment.CreatedDate.ToString("dd/MM/yyyy HH:mm")%>
                        <img alt="" src="/App_Themes/img/comment.png" width="22px" height="22px" />
                    </legend>
                    <%: comment.Description %>
                </fieldset>
            </td>
        </tr>
        <% } %>
    </table>
    <%  using (Html.BeginForm())
        { %>
    <table align="center" width="70%">
        <tr>
            <td>
                <%: Html.LabelFor(comment => comment.Description)%>
                <br />
                <%: Html.TextAreaFor(comment => comment.Description, new { @style = "height:150px;width:500px", @class = "TextBox" })%>
            </td>
            <td>
                <%: Html.ValidationImage(comment => comment.Description)%>
            </td>
        </tr>
        <tr align="right">
            <td>
                <%= Html.CommandField(true, "location='" + Session["UrlReferrer"].ToString() + "'")%>
                <input type="hidden" name="UrlReferrer" id="UrlReferrer" value="" />
            </td>
        </tr>
    </table>
    <% } %>
    <br />
    <br />
    <script type="text/javascript">

        $(function () {
            $("#SubjectTitle").corner();
        })
    </script>
</asp:Content>
